Skip to content

fix(decorators): do not crash on Controller getter#3788

Merged
kamilmysliwiec merged 1 commit intonestjs:masterfrom
robbtraister:bugfix/api-query-with-getter
Apr 9, 2026
Merged

fix(decorators): do not crash on Controller getter#3788
kamilmysliwiec merged 1 commit intonestjs:masterfrom
robbtraister:bugfix/api-query-with-getter

Conversation

@robbtraister
Copy link
Copy Markdown
Contributor

getter descriptors use the .get field rather than .value. If an @ApiQuery-decorated Controller has a getter, we should ignore the getters when applying the decoration to its members.

This change will prevent these types of Controllers from crashing on startup.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

When a controller is decorated with @ApiQuery() and also contains a getter, the app will crash on startup.

Issue Number: N/A

What is the new behavior?

When a controller is decorated with @ApiQuery() and also contains a getter, the app will start as expected.

Does this PR introduce a breaking change?

  • Yes
  • No

getter descriptors use the `.get` field rather than `.value`.
If an @ApiQuery-decorated Controller has a getter, we should ignore the
getters when applying the decoration to its members.

This change will prevent these types of Controllers from crashing on
startup.
@kamilmysliwiec kamilmysliwiec merged commit 96f3d1a into nestjs:master Apr 9, 2026
1 check passed
@kamilmysliwiec
Copy link
Copy Markdown
Member

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants